package ua

import (
	"gitee.com/kennyzw/go-sip-ua/pkg/session"
	"gitee.com/kennyzw/go-sip-ua/pkg/stack"
	"gitee.com/kennyzw/gosip/log"
	"gitee.com/kennyzw/gosip/sip"
	"sync"
)

// leg代表一路呼叫相关实例.

// SessionKey - Session Key for Session Storage
type LegKey struct {
	CallID  sip.CallID
	FromTag sip.MaybeString
	ToTag   sip.MaybeString
}

// NewSessionKey - Build a Session Key quickly
func NewLegKey(callID sip.CallID, from sip.MaybeString, to sip.MaybeString) LegKey {
	return LegKey{
		CallID:  callID,
		FromTag: from,
		ToTag:   to,
	}
}

// UserAgentConfig .
type UserLegConfig struct {
	SipStack *stack.SipStack
}

// SessionHandler：所有基于session的sip消息handler处理.
type SessionHandler func(s *session.Session, req *sip.Request, resp *sip.Response, status session.Status)

//UserLeg : 对应协议栈的一路通话.
type UserLeg struct {
	// InviteStateHandler   InviteSessionHandler
	config *UserAgentConfig
	iss    sync.Map /*Invite Session*/
	log    log.Logger
}
